<?php
/*
 * @FileForDetails: 校区模型
 * @Date: 2022-11-26 15:50:52
 */
namespace app\crm\model\product;

use think\Model;
use think\model\concern\SoftDelete;

class Campus extends Model
{
    // 开区软删除
    use SoftDelete;  
    // 表名
    protected $table = 'yd_crm_campus';
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = true;
    // 定义时间戳字段名
    protected $createTime = 'create_time';
    protected $updateTime = 'update_time';
    protected $deleteTime = 'delete_time';

    /**
     * @Descripttion: 转换删除时间
     * @Date: 2022-11-30 10:45:56
     * @param {*} $value
     * @param {*} $data  整条记录
     */
    public function getDeleteTimeAttr($value, $data)
    {
        return date('Y-m-d H:i:s',$data['delete_time']);
    }
}